<template>
  <a-layout id="add">
    <a-layout-sider
      theme='light'
      breakpoint="lg"
      collapsed-width="0"
      @collapse="onCollapse"
      @breakpoint="onBreakpoint"
    >
      <div class="company_name">
        <div class="left">
          <a-icon type="rollback" class="icon" title="返回信息流推广" @click="goBack"/>
          <span>洪庆科技06</span>
        </div>
      </div>
      <div class="steps">
        <steps :current="1" />
      </div>
    </a-layout-sider>
    <a-layout>
      <a-layout-content :style="{ margin: '24px 16px' }">
        <div :style="{ padding: '0px' }">
          <div class="content">
            <step2 @nextStep="nextStep" @prevStep="prevStep"></step2>
          </div>
        </div>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>

<script>
import Step2 from './Step2'
import steps from './steps.vue'

export default {
  name: 'StepForm',
  i18n: require('./i18n'),
  components: { Step2, steps},
  data () {
    return {
      current: 1
    }
  },
  created(){
    console.log('created',this.$route.query.campaignFeedId)
  },
  computed: {
    desc() {
      return this.$t('pageDesc')
    }
  },
  methods: {
    onCollapse(collapsed, type) {
      console.log(collapsed, type);
    },
    onBreakpoint(broken) {
      console.log(broken);
    },
    goBack(){
      this.$router.push('/xinxiliu')
    },
    nextStep () {
      if (this.current < 2) {
        this.current += 1
      }
    },
    prevStep () {
      if (this.current > 0) {
        this.current -= 1
      }
    },
    finish () {
      this.current = 0
    }
  }
}
</script>

<style lang="less" scoped>
  #add{
    .company_name{
      .left{
        display: flex;
        align-items: center;
        .icon{
          cursor: pointer;
        }
        span{
          font-size: 14px;
          font-weight: 500;
          color: #282c33;
          margin-left: 8px;
        }
      }
      height: 50px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #ebedf5;
      background-color: #ffffff;
      padding: 0 16px
    }
  }
  
</style>
